package cn.org.alexander.entity.response;


/**
 * @author Alexander
 * @date 2022/5/21
 * @desc 错误码
 */
public enum CommonCode implements ResultCode {
    SUCCESS(true, "000000", "成功"),
    MVC_DISPOSE_ERROR(false,"A00001","请求Url异常或不存在!" ),
    REQUEST_METHOD_ERROR(false,"A00002","请求方法类型错误!" ),
    REQUEST_URL_NOT_MATCH(false,"A00003","请求url不存在!" ),
    MISS_REQUEST_PARAM_ERROR(false,"A00004","缺失请求参数错误!" ),
    REQUEST_PARAM_NOT_EMPTY(false,"A00005","请求必要参数不能为空!" ),
    PLEASE_LOGIN(false,"A00006","请进行登陆操作!" ),


    QUERY_NOT_DATA(false, "B00001", "暂无数据"),
    FORBIDDEN(false, "B00002", "禁止访问"),
    UNAUTHENTICATED(false, "B00003", "权限认证错误"),
    UPDATE_DATA_NOT_EXIST(false, "B00004", "暂无更新/删除数据"),
    UPDATE_ERROR(false, "B00005", "更新失败!"),
    DELETE_ERROR(false, "B00007", "删除失败!"),
    ADD_ERROR(false, "B00006", "添加失败"),
    ADD_OR_UPDATE_ERROR(false, "B00008", "更新/删除数据失败!"),
    NOT_OPEN_ID_AUTH_INFO(false, "B00000", "请用手机号登录!"),
    NO_COURSE_INFO(false, "B00009", "没有报名信息!"),
    SERVER_ERROR(false, "B99999", "服务异常,请稍候重试!");

    CommonCode(boolean success, String code, String msg) {
        this.success = success;
        this.code = code;
        this.msg = msg;
    }

    boolean success;
    String code;
    String msg;


    @Override
    public boolean success() {
        return success;
    }

    @Override
    public String code() {
        return code;
    }

    @Override
    public String msg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}